package cn.gok.utils;

import cn.gok.common.entity.backstage.SysUser;
import org.apache.shiro.SecurityUtils;

/**
 * @author: DxlinY
 * @apiNote: 用户相关工具类
 * @date: 2020/9/26
 * @time: 15:10
 */
public class UserContext {

    /**
     * 获取已登录用户
     *
     * @return sysUser
     */
    public static SysUser user() {
        return (SysUser) SecurityUtils.getSubject().getPrincipal();
    }
}
